CC       = gcc
HDRS     = server.h
BASEOBJS = sd_server.o sd_global.o sd_memory.o sd_log.o sd_blist.o sd_hashtable.o sd_syncblist.o sd_synchashtable.o sd_ttree.o sd_thread.o sd_transaction.o  
OBJS     = $(BASEOBJS) speed_test.o
CFLAGS   = -m64 -O2 -Wall 
PROG	 = contest

all: $(PROG)


$(PROG): $(OBJS)
	$(CC) $(CFLAGS) -lpthread -o $(PROG) $(OBJS)

static: $(BASEOBJS)
	$(CC) $(CFLAGS) -shared $(BASEOBJS) -o lib.so

#generates html and latex documentation files in ../docs
doc:
	doxygen Doxyfile

#runs the unit tests with the Berkeley DB implementation
test: $(PROG)
	rm -rf ENV
	./$(PROG)

clean: 
	rm -rf *.o *.so *.dylib $(PROG) ENV error.log

